package my.diplom.dao.service;

import my.diplom.dao.IResourceDAO;
import my.diplom.entity.Resource;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: gb
 * Date: 14.07.2009
 * Time: 17:26:42
 * To change this template use File | Settings | File Templates.
 */
public class ResourceService {

    private IResourceDAO resourceDAO;

    public IResourceDAO getResourceDAO() {
        return resourceDAO;
    }

    public void setResourceDAO(IResourceDAO resourceDAO) {
        this.resourceDAO = resourceDAO;
    }

    public void create(Resource resource) {
        resourceDAO.create(resource);
    }

    public void update(Resource resource) {
        resourceDAO.update(resource);
    }

    public Resource getById(Long resourceId) {
        return resourceDAO.getById(resourceId);
    }

    public List<Resource> getAll() {
        return resourceDAO.getAll();
    }

    public Resource getByName(String resourceName) {
        return resourceDAO.getByName(resourceName);
    }

    public void delete(Resource resource) {
        resourceDAO.delete(resource);
    }

    public List<Resource> getResourcesByLogin(String login) {
        return resourceDAO.getResourcesByLogin(login);
    }

    public List<Resource> getAll(boolean initAll) {
        return resourceDAO.getAll(initAll);
    }

    public Resource getById(Long resourceId, boolean initProjects) {
        return resourceDAO.getById(resourceId, initProjects);
    }
}
